local ClientOHOH = _G.ClientOHOH;

local M = ClientOHOH.class.new(script, ClientOHOH.files.BaseObject())
local CallBackManager = ClientOHOH.load.CallBackManager();

local instStr={
	relicBtn="ctrl.navigation.relic.btn",
	fuseBtn="ctrl.navigation.fuse.btn",
	sacrificeBtn="ctrl.navigation.sacrifice.btn",
	--skinBtn="ctrl.navigation.skins.btn",

	selectedColor = "ctrl.navigation.selectedColor",
    defaultColor = "ctrl.navigation.defaultColor",
 }


function M.new(...)
	return M(...);
end;


function M.ctor(self,ctrl)
	M.super.ctor(self);

    self.ctrl=ctrl
    self.ui=ctrl:InitUiInst2(ctrl.main_inst,instStr)
	self.Select = self.ui.relicBtn

	CallBackManager:AddRbxConnect(self,self.ui.relicBtn.Activated, function()
        if self.Select ~=  self.ui.relicBtn then
           -- self.ctrl.NavChangeEvent:Action()
		    self.ctrl:ShowBox(self.ctrl.RelicBox)
            self.Select.parent.BackgroundColor3 = self.ui.defaultColor
            self.ui.relicBtn.parent.BackgroundColor3 = self.ui.selectedColor
            self.Select =  self.ui.relicBtn
        end
	end);
	CallBackManager:AddRbxConnect(self,self.ui.fuseBtn.Activated, function()
        if self.Select ~= self.ui.fuseBtn then
           -- self.ctrl.NavChangeEvent:Action()
		   self.ctrl.RelicBox:HideTip()
		   self.ctrl:ShowBox(self.ctrl.FuseBox)
            self.Select.parent.BackgroundColor3 = self.ui.defaultColor
            self.ui.fuseBtn.parent.BackgroundColor3 = self.ui.selectedColor
            self.Select =  self.ui.fuseBtn
        end
	end);
	CallBackManager:AddRbxConnect(self,self.ui.sacrificeBtn.Activated, function()
        if self.Select ~= self.ui.sacrificeBtn then
           -- self.ctrl.NavChangeEvent:Action()
            self.Select.parent.BackgroundColor3 = self.ui.defaultColor
            self.ui.sacrificeBtn.parent.BackgroundColor3 = self.ui.selectedColor
            self.Select =  self.ui.sacrificeBtn
        end
	end);
	self:Init()
end;
function M.Init(self)
	self.ui.relicBtn.Active = false
	self.ui.fuseBtn.Active = false
	self.ui.sacrificeBtn.Active = false
end
function M.UpdateNav(self,topData)
	for _,k in ipairs(topData.unlock) do
		if k == 1 then
			self.ui.relicBtn.Active = true
		elseif k == 2 then
			self.ui.fuseBtn.Active = true
		elseif k == 3 then
			self.ui.sacrificeBtn.Active = true
		end
	 end
end;
function M.dtor(self)
	M.super.dtor(self);
end;
function M.HideAll(self)

end;



return M